﻿@model Orchard.Core.Settings.ViewModels.SiteSettingsPartViewModel
@using Orchard.Settings;
@{
    var resourceDebugMode = new SelectList(new object[] {
        new { Id = ResourceDebugMode.FromAppSetting, Text = T("Use web.config setting").Text },
        new { Id = ResourceDebugMode.Enabled, Text = T("Enabled").Text },
        new { Id = ResourceDebugMode.Disabled, Text = T("Disabled").Text },
    }, "Id", "Text", Model.ResourceDebugMode);
}
<fieldset>
    <legend>@T("General")</legend>
    <div>
        <label for="SiteName">@T("Site name")</label>
        @Html.EditorFor(m => m.SiteName)
        @Html.ValidationMessage("SiteName", "*")
    </div>
    <div>
        <label for="@Html.FieldIdFor(m => m.BaseUrl)">@T("Base URL")</label>
        @Html.TextBoxFor(m => m.BaseUrl,
            (object)(AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner)
                ? (dynamic)new { @class = "text medium is-url" }
                : (dynamic)new { @class = "text medium is-url", @readonly = "readonly" }))
        <span class="hint">@T("Enter the fully qualified base URL of the web site.")</span>
        <span class="hint">@T("e.g., http://localhost:30320/orchardlocal, http://www.yourdomain.com")</span>
    </div>
	<div>
		<label for="SiteCulture">@T("Default Site Culture")</label>
		@Html.DropDownList("SiteCulture", new SelectList(Model.SiteCultures, Model.SiteCulture))
		@Html.ValidationMessage("SiteCulture", "*")
		<span class="hint">@T("Determines the default culture used to localize strings and to format and parse numbers, date and times.")</span>
		<p>@Html.ActionLink(T("Add or remove supported cultures for the site").ToString(), "Culture")</p>
	</div>
	<div>
		<label for="SiteCalendar">@T("Default Site Calendar")</label>
		@Html.DropDownList("SiteCalendar", new[] { new SelectListItem { Text = T("Culture calendar").Text, Value = "" } }.Union(new SelectList(Model.SiteCalendars, Model.SiteCalendar)))
		@Html.ValidationMessage("SiteCalendar", "*")
		<span class="hint">@T("Determines the default calendar used when displaying and editing dates and times.")</span>
		<span class="hint">@T("The 'Culture calendar' option means the default calendar for the culture of the current request will be used (not necessarily the configured default site culture).")</span>
	</div>
    <div>
        <label for="TimeZone">@T("Default Time Zone")</label>
        @Html.DropDownList("TimeZone", new[] { new SelectListItem { Text = T("Local to server").Text, Value = "" } }.Union(new SelectList(Model.TimeZones, "Id", "", Model.TimeZone)))
        @Html.ValidationMessage("TimeZone", "*")
        <span class="hint">@T("Determines the default time zone used when displaying and editing dates and times.")</span>
    </div>
    <div>
        <label for="PageTitleSeparator">@T("Page title separator")</label>
        @Html.EditorFor(x => x.PageTitleSeparator)
        @Html.ValidationMessage("PageTitleSeparator", "*")
    </div>
    <div>
        <label for="SuperUser">@T("Super user")</label>
        @Html.TextBoxFor(x => x.SuperUser, 
            (object)(AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner)
                ? (dynamic)new { @class = "text single-line" }
                : (dynamic)new { @class = "text single-line", @readonly = "readonly" }))
        @Html.ValidationMessage("SuperUser", "*")
        <span class="hint">@T("Enter an existing account name, or nothing if you don't want a Super user account")</span>
    </div>
    <div>
        <label for="SiteDebugMode">@T("Resource Debug Mode")</label>
        @Html.DropDownList("ResourceDebugMode", resourceDebugMode)
        <span class="hint">@T("Determines whether scripts and stylesheets load in their debuggable or minified form.")</span>
    </div>
    <div>
        @Html.CheckBoxFor(m => m.UseCdn)
        @Html.LabelFor(m => m.UseCdn, T("Use CDN").Text, new { @class = "forcheckbox" })
	    <span class="hint">@T("Determines whether the defined CDN value is used for scripts and stylesheets, or their local version")</span>
    </div>
    <div>
        <label for="DefaultPageSize">@T("Default number of items per page")</label>
        @Html.TextBoxFor(m => m.PageSize, new { @class = "text small" })
        <span class="hint">@T("Determines the default number of items that are shown per page.")</span>
    </div>
@if (AuthorizedFor(Orchard.Security.StandardPermissions.SiteOwner)) {
    <div>
        <label for="MaxPageSize">@T("Maximum number of items per page")</label>
        @Html.TextBoxFor(m => m.MaxPageSize, new {@class = "text small"})
        <span class="hint">@T("Determines the maximum number of items that are shown per page. Leave 0 for unlimited.")</span>
    </div>
    <div>
        <label for="MaxPagedCount">@T("Last index of items in pages")</label>
        @Html.TextBoxFor(m => m.MaxPagedCount, new { @class = "text small" })
        <span class="hint">@T("Determines the last element of the database that can be displayed. Leave 0 for unlimited.")</span>
    </div>
}
</fieldset>
